const {transformStart} = require("../../utils/index")
Page({
  data: {
    data:"",
    isShow:true
  },
  onLoad: function (options) {
    let {id} = options
    wx.request({
      url: `http://localhost:8080/detail/${id}/`,
      data: {},
      header: {'content-type':'application/json'},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: (result)=>{
        console.log(result.data.data);
        var data = result.data.data
        data.arr = data.arr.join("/")
        data.star = transformStart(data.raiting)
        data.actors = data.actors.slice(0,4)
        this.setData({
          data
        })
      }
    });
  },
  handleShow(){
    this.setData({
      isShow:!this.data.isShow
    })
  }
})